package com.health.healthSys.service.impl;

import java.util.List;

import com.health.common.annotation.DataScope;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.health.healthSys.mapper.HealthDietMapper;
import com.health.healthSys.domain.HealthDiet;
import com.health.healthSys.service.IHealthDietService;

/**
 * 用户饮食记录Service业务层处理
 *
 * @author maple
 * @date 2025-03-02
 */
@Service
public class HealthDietServiceImpl implements IHealthDietService
{
    @Autowired
    private HealthDietMapper healthDietMapper;

    /**
     * 查询用户饮食记录
     *
     * @param dietId 用户饮食记录主键
     * @return 用户饮食记录
     */
    @Override
    public HealthDiet selectHealthDietByDietId(String dietId)
    {
        return healthDietMapper.selectHealthDietByDietId(dietId);
    }

    /**
     * 查询用户饮食记录列表
     *
     * @param healthDiet 用户饮食记录
     * @return 用户饮食记录
     */
    @Override
    @DataScope(userAlias = "hd")
    public List<HealthDiet> selectHealthDietList(HealthDiet healthDiet)
    {
        return healthDietMapper.selectHealthDietList(healthDiet);
    }

    /**
     * 新增用户饮食记录
     *
     * @param healthDiet 用户饮食记录
     * @return 结果
     */
    @Override
    public int insertHealthDiet(HealthDiet healthDiet)
    {
        return healthDietMapper.insertHealthDiet(healthDiet);
    }

    /**
     * 修改用户饮食记录
     *
     * @param healthDiet 用户饮食记录
     * @return 结果
     */
    @Override
    public int updateHealthDiet(HealthDiet healthDiet)
    {
        return healthDietMapper.updateHealthDiet(healthDiet);
    }

    /**
     * 批量删除用户饮食记录
     *
     * @param dietIds 需要删除的用户饮食记录主键
     * @return 结果
     */
    @Override
    public int deleteHealthDietByDietIds(String[] dietIds)
    {
        return healthDietMapper.deleteHealthDietByDietIds(dietIds);
    }

    /**
     * 删除用户饮食记录信息
     *
     * @param dietId 用户饮食记录主键
     * @return 结果
     */
    @Override
    public int deleteHealthDietByDietId(String dietId)
    {
        return healthDietMapper.deleteHealthDietByDietId(dietId);
    }
}
